package com.wh.minio.container.common;

public class Utils {

    /**
     * 监测出现字符串出现几个
     * @param sourceStr  源字符串
     * @param checkStr   检查字符串
     * @return
     */
    public static int countStr(String sourceStr, String checkStr) {
        int index = 0;
        int count = 0;
        int fromindex = 0;
        while((index = sourceStr.indexOf(checkStr, fromindex))!= -1) {

            fromindex = index + checkStr.length();
            count++;
        }
        return count;
    }
}
